/**
 *
 * Copyright 2015 RSVP Technologies Inc. All rights reserved.
 * Taxi.java
 *
 */
package com.gfinal.map.direction;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 出租车
 * 
 * @author Gao Yudong (gyd@nbicc.com)
 * @date 2015-2-28
 */
public class Taxi implements Serializable {
	private static final long serialVersionUID = 3778826813041970159L;

	private int distance = 0;
	private int duration = 0;
	private String remark = null;
	private List<Detail> detail = new ArrayList<Detail>();
	
	public Taxi() {
		super();
	}

	public int getDistance() {
		return distance;
	}

	public void setDistance(int distance) {
		this.distance = distance;
	}

	public int getDuration() {
		return duration;
	}

	public void setDuration(int duration) {
		this.duration = duration;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public List<String> getDetail() {
		if(detail == null || detail.size() == 0) {
			return null;
		}
		List<String> result = new ArrayList<String>();
		for(Detail d : detail) {
			result.add(d.getRemark());
		}
		return result;
	}

	public void setDetail(List<Detail> detail) {
		this.detail = detail;
	}

	@Override
	public String toString() {
		return "Taxi [distance=" + distance + ", duration=" + duration
				+ ", remark=" + remark + ", detail=" + detail + "]";
	}
	
	class Detail implements Serializable {
		private static final long serialVersionUID = 4037180347343197380L;

		private String desc = null;
		private String km_price = null;
		private String start_price = null;
		/**
		 * 总价格
		 */
		private String total_price = null;

		public Detail() {
			super();
		}

		public String getDesc() {
			return desc;
		}

		public void setDesc(String desc) {
			this.desc = desc;
		}

		public String getKm_price() {
			return km_price;
		}

		public void setKm_price(String km_price) {
			this.km_price = km_price;
		}

		public String getStart_price() {
			return start_price;
		}

		public void setStart_price(String start_price) {
			this.start_price = start_price;
		}

		public String getTotal_price() {
			return total_price;
		}

		public void setTotal_price(String total_price) {
			this.total_price = total_price;
		}
		
		public String getRemark() {
			StringBuffer sb = new StringBuffer();
			sb.append(desc);
			sb.append("\n");
			sb.append("约");
			sb.append(total_price);
			sb.append("元(起步价");
			sb.append(start_price);
			sb.append("，每公里");
			sb.append(km_price);
			sb.append("元)");
			return sb.toString();
		}

		@Override
		public String toString() {
			return "Detail [desc=" + desc + ", km_price=" + km_price
					+ ", start_price=" + start_price + ", total_price="
					+ total_price + "]";
		}
	}
}
